﻿using System;
using ReAnimation.MVP.ViewInterfaces;


namespace ReAnimation.MVP.Presenters
{
    public class LoginPresenter: BasePresenter<ILoginView>
    {/*
        private IMainModel _mainModel;
        private IUserDao _userDao;
        private INotifier _notifier;
        */

        public LoginPresenter()
        {
            /*_mainModel = mainModel;
            _notifier = notifier;
            _userDao = userDao;*/
        }

        protected override void InitView()
        {
            _view.Login += LoginHandler;
        }

        void LoginHandler(object sender, EventArgs e)
        {/*
            User user = _userDao.GetByLogin(_view.Username);
            if(user == null)
            {
                _notifier.ShowMessage("Error","No such user");
                return;
            }
            if(user.Password != _view.Password)
                _notifier.ShowMessage("Error","Wrong password");
            else
            {
                _mainModel.CurrentUser = user;
                _view.DialogResult = DialogResult.OK;
                _view.Close();
            }*/
        }
    }
}
